#region Using

	using System;
	using System.Collections;
	using System.Collections.Concurrent;
	using System.Collections.Generic;
	using System.Collections.ObjectModel;
	using System.Collections.Specialized;
	using System.ComponentModel;
	using System.ComponentModel.Composition;
	using System.ComponentModel.Composition.AttributedModel;
	using System.ComponentModel.Composition.Diagnostics;
	using System.ComponentModel.Composition.Hosting;
	using System.ComponentModel.Composition.Primitives;
	using System.ComponentModel.Composition.ReflectionModel;
	using System.ComponentModel.DataAnnotations;
	using System.ComponentModel.DataAnnotations.Resources;
	using System.ComponentModel.Design;
	using System.ComponentModel.Design.Data;
	using System.ComponentModel.Design.Serialization;
	using System.Configuration;
	using System.Configuration.Assemblies;
	using System.Data;
	using System.Data.Common;
	using System.Data.Odbc;
	using System.Data.OleDb;
	using System.Data.ProviderBase;
	using System.Data.Sql;
	using System.Data.SqlClient;
	using System.Data.SqlTypes;
	using System.Diagnostics;
	using System.Diagnostics.Contracts;
	using System.Diagnostics.Contracts.Internal;
	using System.Diagnostics.PerformanceData;
	using System.Dynamic;
	using System.Globalization;
	using System.IO;
	using System.IO.Compression;
	using System.IO.IsolatedStorage;
	using System.IO.MemoryMappedFiles;
	using System.IO.Pipes;
	using System.IO.Ports;
	using System.Linq;
	using System.Linq.Expressions;
	using System.Management; 
	using System.Management.Instrumentation;
	using System.Media;
	using System.Net;
	using System.Net.Cache;
	using System.Net.Configuration;
	using System.Net.Mail;
	using System.Net.Mime;
	using System.Net.NetworkInformation;
	using System.Net.Security;
	using System.Net.Sockets;
	using System.Reflection;
	using System.Reflection.Cache;
	using System.Reflection.Emit;
	using System.Resources;
	using System.Runtime.Caching;
	using System.Runtime.Caching.Configuration;
	using System.Runtime.Caching.Hosting;
	using System.Runtime.Collections;
	using System.Runtime.CompilerServices;
	using System.Runtime.ConstrainedExecution;
	using System.Runtime.Diagnostics;
	using System.Runtime.DurableInstancing;
	using System.Runtime.ExceptionServices;
	using System.Runtime.Hosting;
	using System.Runtime.Interop;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.InteropServices.Expando;
	using System.Runtime.InteropServices.TCEAdapterGen;
	using System.Runtime.Remoting;
	using System.Runtime.Remoting.Activation;
	using System.Runtime.Remoting.Channels;
	using System.Runtime.Remoting.Channels.Http;
	using System.Runtime.Remoting.Channels.Ipc;
	using System.Runtime.Remoting.Channels.Tcp;
	using System.Runtime.Remoting.Contexts;
	using System.Runtime.Remoting.Lifetime;
	using System.Runtime.Remoting.Messaging;
	using System.Runtime.Remoting.Metadata;
	using System.Runtime.Remoting.Metadata.W3cXsd2001;
	using System.Runtime.Remoting.MetadataServices;
	using System.Runtime.Remoting.Proxies;
	using System.Runtime.Remoting.Services;
	using System.Runtime.Serialization;
	using System.Runtime.Serialization.Configuration;
	using System.Runtime.Serialization.Diagnostics;
	using System.Runtime.Serialization.Formatters;
	using System.Runtime.Serialization.Formatters.Binary;
	using System.Runtime.Serialization.Formatters.Soap;
	using System.Runtime.Serialization.Json;
	using System.Runtime.Versioning;
	using System.Security;
	using System.Security.AccessControl;
	using System.Security.Authentication;
	using System.Security.Authentication.ExtendedProtection;
	using System.Security.Authentication.ExtendedProtection.Configuration;
	using System.Security.Cryptography;
	using System.Security.Cryptography.Pkcs;
	using System.Security.Cryptography.X509Certificates;
	using System.Security.Cryptography.Xml;
	using System.Security.Permissions;
	using System.Security.Policy;
	using System.Security.Principal;
	using System.Security.Util;
	using System.Text;
	using System.Text.RegularExpressions;
	using System.Threading;
	using System.Threading.Tasks;
	using System.Timers;
	using System.Xml;
	using System.Xml.Linq;
	using System.Xml.Resolvers;
	using System.Xml.Schema;
	using System.Xml.Serialization;
	using System.Xml.Serialization.Advanced;
	using System.Xml.Serialization.Configuration;
	using System.Xml.XPath;
	using System.Xml.Xsl;
	using System.Web;
	using System.Windows.Forms;

	using Microsoft;
	using Microsoft.Runtime;
	using Microsoft.Runtime.Hosting;
	using Microsoft.Internal;
	using Microsoft.Internal.Collections;
	using Microsoft.Internal.Performance;
	using Microsoft.Internal.Runtime;
	using Microsoft.Internal.Runtime.Serialization;
	using Microsoft.Win32;
	using Microsoft.Win32.SafeHandles;

	using Trinet.NTFS;

#endregion

using WBFSLibrary.IO;
using WBFSLibrary.IO.Drives;
using WBFSLibrary.IO.FileSystems;
using WBFSLibrary.IO.FileTypes;
using WBFSLibrary.IO.FileOperations;
using WBFSLibrary.IO.Partitions;
using WBFSLibrary.IO.Streams;
using WBFSLibrary.Plugins;
using WBFSLibrary.Network;
using WBFSLibrary.Network.Internet;
using WBFSLibrary.Network.Local;
using WBFSLibrary.Properties;

namespace WBFSLibrary
{

    static public class CollectionExtensions
    {
		#region Static Fields

        #endregion

		#region Static Methods

		    #region Methods

				public static void AddRange<T>(this Collection<T> collection, IEnumerable<T> values)
				{
					foreach (var item in values)
					{
						collection.Add(item);
					}
				}

				public static T Find<T>(this Collection<T> collection, Predicate<T> predicate)
				{
					foreach (var item in collection)
					{
						if (predicate(item))
							return item;
					}
					return default(T);
				}

				public static Collection<T> FindAll<T>(this Collection<T> collection, Predicate<T> predicate)
				{
					Collection<T> all = new Collection<T>();
					foreach (var item in collection)
					{
						if (predicate(item))
							all.Add(item);
					}
					return all;
				}

				public static int FindIndex<T>(this Collection<T> collection, Predicate<T> predicate)
				{
					return FindIndex<T>(collection, 0, predicate);
				}

				public static int FindIndex<T>(this Collection<T> collection, int startIndex, Predicate<T> predicate)
				{
					return FindIndex(collection, startIndex, collection.Count, predicate);
				}

				public static int FindIndex<T>(this Collection<T> collection, int startIndex, int count, Predicate<T> predicate)
				{
					for (int i = startIndex; i < count; i++)
					{
						if (predicate(collection[i]))
							return i;
					}
					return -1;
				}

				public static T FindLast<T>(this Collection<T> collection, Predicate<T> predicate)
				{
					for (int i = collection.Count - 1; i >= 0; i--)
					{
						if (predicate(collection[i]))
							return collection[i];
					}
					return default(T);
				}

				public static int FindLastIndex<T>(this Collection<T> collection, Predicate<T> predicate)
				{
					return FindLastIndex<T>(collection, collection.Count - 1, predicate);
				}

				public static int FindLastIndex<T>(this Collection<T> collection, int startIndex, Predicate<T> predicate)
				{
					return FindLastIndex<T>(collection, startIndex, startIndex + 1, predicate);

				}

				public static int FindLastIndex<T>(this Collection<T> collection, int startIndex, int count, Predicate<T> predicate)
				{
					for (int i = startIndex; i >= startIndex - count; i--)
					{
						if (predicate(collection[i]))
							return i;
					}
					return -1;
				}

				public static void ForEach<T>(this Collection<T> collection, Action<T> action)
				{
					foreach (var item in collection)
					{
						action(item);
					}
				}

				public static int RemoveAll<T>(this Collection<T> collection, Predicate<T> match)
				{
					int count = 0;
					for (int i = 0; i < collection.Count; i++)
					{
						if (match(collection[i]))
						{
							collection.Remove(collection[i]);
							count++;
							i--;
						}
					}
					return count;
				}

				public static bool TrueForAll<T>(this Collection<T> collection, Predicate<T> match)
				{
					foreach (var item in collection)
					{
						if (!match(item))
							return false;
					}
					return true;
				}

            #endregion

        #endregion
    }

}
